From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx@linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces@linuxgrrls.org > [mailto:rxtx-bounces@linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx@linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine@linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine@linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine@linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 14 23:21:55 2006 Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj@www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx@linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces@linuxgrrls.org > [mailto:rxtx-bounces@linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx@linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine@linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine@linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine@linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0001.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 18:25:18 2006 Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj@www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx@linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx@linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces@linuxgrrls.org > [mailto:rxtx-bounces@linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx@linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine@linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine@linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Tue Mar 28 20:17:14 2006 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine@linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Tue Mar 28 20:17:15 2006 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0002.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:15 2006 Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj@www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Tue Mar 28 20:17:15 2006 Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj@www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0003.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0004.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0005.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0006.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0007.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0008.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0009.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0010.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0011.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0012.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0013.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0014.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0015.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0016.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0017.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0018.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0019.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0020.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0021.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0022.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0023.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0024.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0025.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0026.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0027.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0028.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0029.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0030.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0031.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0032.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0033.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0034.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0035.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0036.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0037.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0038.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0039.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0040.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0041.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0042.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0043.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0044.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0045.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0046.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0047.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0048.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0049.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0050.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0051.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0052.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0053.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0054.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0055.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0056.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0057.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0058.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0059.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0060.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0061.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0062.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0063.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0064.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0065.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0066.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0067.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0068.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0069.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0070.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0071.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0072.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0073.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0074.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0075.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0076.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0077.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0078.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0079.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0080.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0081.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0082.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0083.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0084.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0085.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0086.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0087.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0088.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0089.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0090.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0091.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0092.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0093.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0094.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0095.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0096.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0097.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0098.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0099.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0100.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0101.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0102.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0103.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0104.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0105.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0106.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0107.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0108.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0109.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0110.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0111.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0112.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0113.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0114.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0115.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0116.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0117.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0118.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0119.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0120.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0121.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0122.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0123.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0124.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0125.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0126.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0127.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0128.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0129.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0130.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0131.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0132.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0133.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0134.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0135.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0136.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only. It also seems that you need to pause for a while in between opening the port and sending the first command. (1 second is enough, possibly less.) Pretty silly, but you live and learn! Glen. -----Original Message----- From: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]On Behalf Of Dodger Sent: 31 October 2004 17:29 To: rxtx at linuxgrrls.org Subject: [Rxtx] Modem/Serial Comm. Problem Hi, I've spent two full days trying to find an answer to this question, without any luck. When I send an AT command to my modem it just echo's it right back at me, instead of sending some form of acknowledgement, such as an OK response code. Of course, this means it doesn't respond correctly to dialling commands either (AT Dnnnnnnn). The problem is this: BlackBox works, as well as another sample application I have -- just not code (typical). Any ideas as to why this is happening? Could it be that my sending and receiving is not done in separate threads? Some info: OS: Windows 2000 JDK: 1.5.0 Modem: 3Com U.S. Robotics 56K Faxmodem My code follows: (Test & _SerialPort) ==[ Test ] public class Test { public static void main(String[] arguments) { _SerialPort port = new _SerialPort(); port.open(); port.write("AT D7152016;\r"); try { Thread.sleep(10000); } catch(InterruptedException e) { System.err.println(e); } port.close(); } } == ==[_SerialPort] import gnu.io.*; import java.io.*; import java.util.TooManyListenersException; public class _SerialPort implements SerialPortEventListener, CommPortOwnershipListener { private CommPortIdentifier portID; private SerialPort serialPort; private InputStream in; private OutputStream out; private byte[] buffer = new byte[2048]; public _SerialPort() { // TODO: Pass parameter object to constructor } public void open() { try { portID = CommPortIdentifier.getPortIdentifier("COM1"); } catch(NoSuchPortException e) { System.err.println(e); } try { serialPort = (SerialPort)portID.open("_SerialPort", 5000); } catch(PortInUseException e) { System.err.println(e); } try { in = serialPort.getInputStream(); out = serialPort.getOutputStream(); } catch(IOException e) { System.err.println(e); } try { serialPort.addEventListener(this); } catch(TooManyListenersException e) { System.err.println(e); } serialPort.notifyOnBreakInterrupt(true); serialPort.notifyOnCarrierDetect(true); serialPort.notifyOnCTS(true); serialPort.notifyOnDataAvailable(true); serialPort.notifyOnDSR(true); serialPort.notifyOnFramingError(true); serialPort.notifyOnOutputEmpty(true); serialPort.notifyOnOverrunError(true); serialPort.notifyOnParityError(true); serialPort.notifyOnRingIndicator(true); portID.addPortOwnershipListener(this); } public void write(String data) { try { out.write(data.getBytes()); } catch(IOException e) { System.err.println(e); } } public void close() { try { // Close the i/o streams in.close(); out.close(); } catch(IOException e) { System.err.println(e); } // Close the port. serialPort.close(); // Remove the ownership listener portID.removePortOwnershipListener(this); } public void serialEvent(SerialPortEvent evt) { switch(evt.getEventType()) { // Break interrupt case SerialPortEvent.BI: System.out.println("Break interrupt"); break; // Carrier detect case SerialPortEvent.CD: System.out.println("Carrier detect"); break; // Clear to send case SerialPortEvent.CTS: System.out.println("Clear to send"); break; // Data available at the serial port case SerialPortEvent.DATA_AVAILABLE: int count; try { while(in.available() > 0) { count = in.read(buffer); if(count > 0) { if(count > buffer.length) { System.err.println("Input buffer overflow"); } System.out.println(new String(buffer, 0, count)); } } } catch(IOException e) { System.err.println(e); } break; // Data set ready case SerialPortEvent.DSR: System.out.println("Data set ready"); break; // Framing error case SerialPortEvent.FE: System.out.println("Framing error"); break; // Overrun error case SerialPortEvent.OE: System.out.println("Overrun error"); break; // Output buffer is empty case SerialPortEvent.OUTPUT_BUFFER_EMPTY: System.out.println("Output buffer is empty"); break; // Parity error case SerialPortEvent.PE: System.out.println("Parity error"); break; // Ring indicator case SerialPortEvent.RI: System.out.println("Ring indicator"); break; } } public void ownershipChange(int type) { switch(type) { case CommPortOwnershipListener.PORT_OWNED: System.out.println("PORT_OWNED"); break; case CommPortOwnershipListener.PORT_OWNERSHIP_REQUESTED: System.out.println("PORT_OWNERSHIP_REQUESTED"); break; case CommPortOwnershipListener.PORT_UNOWNED: System.out.println("PORT_UNOWNED"); break; } } } == If you have any other working sample code for serial/modem i/o, please send it my way. Thanks, Glen. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://mailman.linuxgrrls.org/mailman/listinfo/rxtx From sean_gilbertson at fin-rec.com Wed Nov 3 07:58:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 08:58:44 -0600 Subject: [Rxtx] re: Garbage data In-Reply-To: <20041102164337.GA459@demeter> References: <20041102164337.GA459@demeter> Message-ID: <20041103145844.GA14516@demeter> Looking further into this issue, I discovered that the bar code format we were using was unreliable and may have resulted in invalid values being read. If anyone does know of any issues resulting in receiving bogus data, though, please still let me know. On Tue, Nov 02, 2004 at 10:43:37AM -0600, Sean Gilbertson wrote: > > I'm using RXTX 2.0-5 > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From rwang at redrocksemi.com Wed Nov 3 10:31:00 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 09:31:00 -0800 (PST) Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: <20041103173100.95012.qmail@web209.biz.mail.re2.yahoo.com> Thanks a lot, Glen. I will try it. Raine --- Dodger wrote: > Found the problem... > > I wasn't sending a hang-up command so the modem was > remaining in an off-hook > state. This explains why it was working on first > execution only. > > It also seems that you need to pause for a while in > between opening the port > and sending the first command. (1 second is enough, > possibly less.) > > Pretty silly, but you live and learn! > > Glen. > > -----Original Message----- > From: rxtx-bounces at linuxgrrls.org > [mailto:rxtx-bounces at linuxgrrls.org]On > Behalf Of Dodger > Sent: 31 October 2004 17:29 > To: rxtx at linuxgrrls.org > Subject: [Rxtx] Modem/Serial Comm. Problem > > > Hi, > > I've spent two full days trying to find an answer to > this question, without > any luck. > > When I send an AT command to my modem it just echo's > it right back at me, > instead of sending some form of acknowledgement, > such as an OK response > code. > > Of course, this means it doesn't respond correctly > to dialling commands > either (AT Dnnnnnnn). > > The problem is this: BlackBox works, as well as > another sample application I > have -- just not code (typical). > > Any ideas as to why this is happening? Could it be > that my sending and > receiving is not done in separate threads? > > Some info: > OS: Windows 2000 > JDK: 1.5.0 > Modem: 3Com U.S. Robotics 56K Faxmodem > > My code follows: (Test & _SerialPort) > > ==[ Test ] > public class Test > { > public static void main(String[] arguments) > { > _SerialPort port = new _SerialPort(); > > port.open(); > port.write("AT D7152016;\r"); > > try { > Thread.sleep(10000); > } catch(InterruptedException e) { > System.err.println(e); > } > > port.close(); > } > } > == > > ==[_SerialPort] > import gnu.io.*; > import java.io.*; > import java.util.TooManyListenersException; > > public class _SerialPort > implements SerialPortEventListener, > CommPortOwnershipListener > { > private CommPortIdentifier portID; > private SerialPort serialPort; > private InputStream in; > private OutputStream out; > > private byte[] buffer = new byte[2048]; > > public _SerialPort() > { > // TODO: Pass parameter object to constructor > } > > public void open() > { > try { > portID = > CommPortIdentifier.getPortIdentifier("COM1"); > } catch(NoSuchPortException e) { > System.err.println(e); > } > > try { > serialPort = > (SerialPort)portID.open("_SerialPort", 5000); > } catch(PortInUseException e) { > System.err.println(e); > } > > try { > in = serialPort.getInputStream(); > out = serialPort.getOutputStream(); > } catch(IOException e) { > System.err.println(e); > } > > try { > serialPort.addEventListener(this); > } catch(TooManyListenersException e) { > System.err.println(e); > } > > serialPort.notifyOnBreakInterrupt(true); > serialPort.notifyOnCarrierDetect(true); > serialPort.notifyOnCTS(true); > serialPort.notifyOnDataAvailable(true); > serialPort.notifyOnDSR(true); > serialPort.notifyOnFramingError(true); > serialPort.notifyOnOutputEmpty(true); > serialPort.notifyOnOverrunError(true); > serialPort.notifyOnParityError(true); > serialPort.notifyOnRingIndicator(true); > > portID.addPortOwnershipListener(this); > } > > public void write(String data) > { > try { > out.write(data.getBytes()); > } catch(IOException e) { > System.err.println(e); > } > } > > public void close() > { > try { > // Close the i/o streams > in.close(); > out.close(); > } catch(IOException e) { > System.err.println(e); > } > > // Close the port. > serialPort.close(); > > // Remove the ownership listener > portID.removePortOwnershipListener(this); > } > > public void serialEvent(SerialPortEvent evt) > { > switch(evt.getEventType()) > { > // Break interrupt > case SerialPortEvent.BI: > System.out.println("Break interrupt"); > break; > > // Carrier detect > case SerialPortEvent.CD: > System.out.println("Carrier detect"); > break; > > // Clear to send > case SerialPortEvent.CTS: > System.out.println("Clear to send"); > break; > > // Data available at the serial port > case SerialPortEvent.DATA_AVAILABLE: > > int count; > > try { > while(in.available() > 0) > { > count = in.read(buffer); > > if(count > 0) > { > if(count > buffer.length) > { > System.err.println("Input buffer overflow"); > === message truncated === From neil.benn at gmail.com Wed Nov 3 11:18:26 2004 From: neil.benn at gmail.com (Neil Benn) Date: Wed, 3 Nov 2004 19:18:26 +0100 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041102164244.GA378@demeter> References: <20041102164244.GA378@demeter> Message-ID: Hello, According to what/where you are running, that could be normal serial data loss from your environment. Have you tried running a soak test using a different setup? Cheers, Neil On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson wrote: > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > -- > Sean Gilbertson > IT Systems/Software Developer > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From sean_gilbertson at fin-rec.com Wed Nov 3 11:25:49 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 12:25:49 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> Message-ID: <20041103182549.GA17519@demeter> I've just updated some of my code, so if some of the values are still getting by tomorrow, some testing such as you suggest may be prudent. Are you saying that this can occur in any program that communicates with the serial port, or are you saying that it's usually bugs? What do you mean by "different setup"? On Wed, Nov 03, 2004 at 07:18:26PM +0100, Neil Benn wrote: > Hello, > > According to what/where you are running, that could be > normal serial data loss from your environment. Have you tried running > a soak test using a different setup? > > Cheers, > > Neil > > > On Tue, 2 Nov 2004 10:42:44 -0600, Sean Gilbertson > wrote: > > > > Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. > > > > -- > > Sean Gilbertson > > IT Systems/Software Developer > > > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:03:57 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:03:57 -0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103182549.GA17519@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> Message-ID: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> > > I've just updated some of my code, so if some of the values are still > getting by tomorrow, some testing such as you suggest may be prudent. > Are you saying that this can occur in any program that communicates with > the serial port, or are you saying that it's usually bugs? What do you > mean by "different setup"? RS232 is not error checked and as a consequence is not 100% reliable. This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on barcodes exist. Kindly use them. -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:12:33 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:12:33 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> Message-ID: <20041103201233.GA19863@demeter> Well obviously there is no RS232 stack (that I know of). As I was stating in my own response to this thread, the bar code format we use for our cards is, as I discovered the other day, insecure in that it only specifies two bookend values to evaluate compliance. As a result, any of the content may be invalid; unlike some of the more popular bar code formats, this format (codabar-c) does not feature reliable error detection. On Wed, Nov 03, 2004 at 08:03:57PM -0000, jasmine at linuxgrrls.org wrote: > > > > I've just updated some of my code, so if some of the values are still > > getting by tomorrow, some testing such as you suggest may be prudent. > > Are you saying that this can occur in any program that communicates with > > the serial port, or are you saying that it's usually bugs? What do you > > mean by "different setup"? > > RS232 is not error checked and as a consequence is not 100% reliable. > This, and reasons like it, are why XMODEM, TCP/IP, and the check digits on > barcodes exist. Kindly use them. > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:14:31 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:14:31 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103201233.GA19863@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Well obviously there is no RS232 stack (that I know of). As I was > stating in my own response to this thread, the bar code format we > use for our cards is, as I discovered the other day, insecure in > that it only specifies two bookend values to evaluate compliance. > As a result, any of the content may be invalid; unlike some of the > more popular bar code formats, this format (codabar-c) does not > feature reliable error detection. Then for reliability you need to change your software to calculate an ECC and add it to every printed barcode. If your system has time to scan again on invalid data, a simple error checking hash could be enough; otherwise, for example in an automated assembly line, you may need to use a full Reed-Solomon type error recovery algorithm. There is no reliable way to avoid doing this. Sorry :-( -J. From sean_gilbertson at fin-rec.com Wed Nov 3 13:27:05 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Wed, 3 Nov 2004 14:27:05 -0600 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> Message-ID: <20041103202705.GA20010@demeter> Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: * Reprint all employee cards using a reliable format. * Replace all damaged cards when errors occur, and accept the risk. * Couple card scans with the entry of a pre-existing identifier. The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > Well obviously there is no RS232 stack (that I know of). As I was > > stating in my own response to this thread, the bar code format we > > use for our cards is, as I discovered the other day, insecure in > > that it only specifies two bookend values to evaluate compliance. > > As a result, any of the content may be invalid; unlike some of the > > more popular bar code formats, this format (codabar-c) does not > > feature reliable error detection. > > Then for reliability you need to change your software to calculate an ECC > and add it to every printed barcode. If your system has time to scan > again on invalid data, a simple error checking hash could be enough; > otherwise, for example in an automated assembly line, you may need to use > a full Reed-Solomon type error recovery algorithm. > > There is no reliable way to avoid doing this. Sorry :-( > > -J. -- Sean Gilbertson IT Systems/Software Developer Financial Recovery Services, Inc. 952-831-4800 x1211 This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From jasmine at linuxgrrls.org Wed Nov 3 13:31:15 2004 From: jasmine at linuxgrrls.org (jasmine@linuxgrrls.org) Date: Wed, 3 Nov 2004 20:31:15 +0000 (GMT) Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: On Wed, 3 Nov 2004, Sean Gilbertson wrote: > Does codabar allow for ECC? I don't know that it does, and even if > it did, to reliably calculate checksums you need to generate > numbers that fit the given algorithm. I don't believe we could do > that for a system that assigns numbers sequentially. Any barcode that can code digits will code ECC; it's just a bunch of digits you add to the 'payload' data at the end of the barcode. It needn't go any further than the printed barcode and doesn't even need to be in the human-readable equivalent that is usually printed below it. Obviously you'd have to add code to generate the checksums to your barcode printing software and you'd need to add code to do the error check and remove the ECC check-digits to your Java application. This doesn't seem all that difficult, if you have access to the code that prints the cards... -J. From rwang at redrocksemi.com Wed Nov 3 16:09:34 2004 From: rwang at redrocksemi.com (Raine Wang) Date: Wed, 3 Nov 2004 15:09:34 -0800 (PST) Subject: [Rxtx] reading data from serial port on redhat Message-ID: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Hi, I wrote a program to read external device's data thought serial port. This program need to run at windows and linux. It runs at windows very well. But when it runs at linux, it meets a weird problem with the same external device. It can't get data from the serial port.It checked the available() and uses enableReceiveTimeout(). I found there is no data available. But if I turn on the external device after the redhat booted up, the program can run and get data. This program doesn't meet this problem at windows. This external device doesn't need the driver, it talks with the pc throught serial port. Now I am wondering if it is the OS problem or the program problem. This is far from my limited knowledge. Welcome any idea. Thanks in advance. From neil.benn at gmail.com Thu Nov 4 13:43:01 2004 From: neil.benn at gmail.com (Neil Benn) Date: Thu, 4 Nov 2004 20:43:01 +0000 Subject: [Rxtx] Garbage/invalid data? In-Reply-To: <20041103202705.GA20010@demeter> References: <20041102164244.GA378@demeter> <20041103182549.GA17519@demeter> <40001.192.168.0.2.1099512237.squirrel@192.168.0.2> <20041103201233.GA19863@demeter> <20041103202705.GA20010@demeter> Message-ID: Hello, Barcodes can have a checksum on them (some don't!!) so which the scanner can check if that checksum doesn't match then the scanner will not return the correct character. Also you can use a better barcode algoritmn than codabar - code 128 has good built in checksumming and will give you less misreads. In addition you can also (as the previous poster mentioned) add a checksum into the barcode itself. Finally if you require secure barcode susceptible to damage - look at 2D barcodes although this is a major change and the barcode reders aer much more expensive than the normal 1D barcodes (yes there is a 3D barcode!!). To avoid noise scewing your transmission up - you need to check if that is the problem - so if you suspect taht your RxTx is giving you problems then try reading with a simple terminal program or a simple test script insomething like python. This is what I mean by a different set-up - I've had serious problem with adjacent equipment that is not correctly shielded and I got monkeys typing shakesphere down the cable!! So thry moving your test rig to another room - although this is obviously not a suitable long term solution!! Also you can look at sheilding your cable or use RJ45/D plug converters - this will let you use CAT5 cable which have a smaller chance of misreading. This lack of ensuring the 'message got there# unlke ethernet communciation is what makes serial so communication so much fun!! Cheers, Neil On Wed, 3 Nov 2004 14:27:05 -0600, Sean Gilbertson wrote: > > Yeah I was really bummed out when I found out that the error code format is so poor. A few options I've thought of are: > > * Reprint all employee cards using a reliable format. > * Replace all damaged cards when errors occur, and accept the risk. > * Couple card scans with the entry of a pre-existing identifier. > > The second response is probably the most practical. However, our business fundamentally requires the addition of employees to increase income, and since we're adding employees quickly, at some point we should probably at least consider switching formats altogether. > > Does codabar allow for ECC? I don't know that it does, and even if it did, to reliably calculate checksums you need to generate numbers that fit the given algorithm. I don't believe we could do that for a system that assigns numbers sequentially. > > > > On Wed, Nov 03, 2004 at 08:14:31PM +0000, jasmine at linuxgrrls.org wrote: > > > > > > On Wed, 3 Nov 2004, Sean Gilbertson wrote: > > > > > Well obviously there is no RS232 stack (that I know of). As I was > > > stating in my own response to this thread, the bar code format we > > > use for our cards is, as I discovered the other day, insecure in > > > that it only specifies two bookend values to evaluate compliance. > > > As a result, any of the content may be invalid; unlike some of the > > > more popular bar code formats, this format (codabar-c) does not > > > feature reliable error detection. > > > > Then for reliability you need to change your software to calculate an ECC > > and add it to every printed barcode. If your system has time to scan > > again on invalid data, a simple error checking hash could be enough; > > otherwise, for example in an automated assembly line, you may need to use > > a full Reed-Solomon type error recovery algorithm. > > > > There is no reliable way to avoid doing this. Sorry :-( > > > > -J. > > -- > Sean Gilbertson > IT Systems/Software Developer > Financial Recovery Services, Inc. > 952-831-4800 x1211 > > This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://mailman.linuxgrrls.org/mailman/listinfo/rxtx > From kmccoig at ist.ucf.edu Sat Nov 6 20:33:45 2004 From: kmccoig at ist.ucf.edu (McCoig, Kenneth) Date: Sat, 6 Nov 2004 22:33:45 -0500 Subject: [Rxtx] native VM errors in Debian? Message-ID: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Hello list! My setup: Debian, latest Sun Java SDK Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install Followed the HOWTO for setting up RXTX. I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x40009315 Function=_dl_relocate_object+0x65 Library=/lib/ld-linux.so.2 Current Java thread: at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586) - locked <0x44770270> (a java.util.Vector) - locked <0x447888d8> (a java.util.Vector) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503) at java.lang.Runtime.loadLibrary0(Runtime.java:788) - locked <0x44783368> (a java.lang.Runtime) at java.lang.System.loadLibrary(System.java:834) at gnu.io.RXTXCommDriver.(RXTXCommDriver.java:72) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at javax.comm.CommPortIdentifier.loadDriver(CommPortIdentifier.java:165) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:260) at read.main(read.java:20) Dynamic libraries: 08048000-08056000 r-xp 00000000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 08056000-08059000 rw-p 0000d000 03:06 7676511 /usr/local/lib/j2sdk1.4.2_06/bin/java 40000000-40016000 r-xp 00000000 03:02 2121049 /lib/ld-2.3.2.so 40016000-40017000 rw-p 00015000 03:02 2121049 /lib/ld-2.3.2.so 40018000-40020000 r-xp 00000000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40020000-40021000 rw-p 00007000 03:06 4315178 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/native_threads/libhpi.so 40021000-4002e000 r-xp 00000000 03:02 2142240 /lib/libpthread-0.10.so 4002e000-40030000 rw-p 0000c000 03:02 2142240 /lib/libpthread-0.10.so 40072000-40074000 r-xp 00000000 03:02 2121910 /lib/libdl-2.3.2.so 40074000-40075000 rw-p 00002000 03:02 2121910 /lib/libdl-2.3.2.so 40076000-4019e000 r-xp 00000000 03:02 2121903 /lib/libc-2.3.2.so 4019e000-401a6000 rw-p 00127000 03:02 2121903 /lib/libc-2.3.2.so 401a9000-405a5000 r-xp 00000000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405a5000-405c1000 rw-p 003fb000 03:06 6466681 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/client/libjvm.so 405d3000-405e5000 r-xp 00000000 03:02 2121913 /lib/libnsl-2.3.2.so 405e5000-405e6000 rw-p 00011000 03:02 2121913 /lib/libnsl-2.3.2.so 405e8000-40609000 r-xp 00000000 03:02 2121911 /lib/libm-2.3.2.so 40609000-4060a000 rw-p 00020000 03:02 2121911 /lib/libm-2.3.2.so 4060a000-4060e000 rw-s 00000000 03:02 2644094 /tmp/hsperfdata_root/935 4060e000-40611000 r--s 00000000 03:06 7673084 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/dnsns.jar 40613000-4061a000 r-xp 00000000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061a000-4061b000 rw-p 00006000 03:02 2121914 /lib/libnss_compat-2.3.2.so 4061b000-40623000 r-xp 00000000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40623000-40624000 rw-p 00007000 03:02 2121918 /lib/libnss_nis-2.3.2.so 40624000-4062c000 r-xp 00000000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062c000-4062d000 rw-p 00008000 03:02 2121916 /lib/libnss_files-2.3.2.so 4062d000-4063d000 r-xp 00000000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063d000-4063f000 rw-p 0000f000 03:06 3291951 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libverify.so 4063f000-4065f000 r-xp 00000000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 4065f000-40661000 rw-p 0001f000 03:06 3291952 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libjava.so 40661000-40675000 r-xp 00000000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40675000-40678000 rw-p 00013000 03:06 3291954 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/libzip.so 40678000-4201f000 r--s 00000000 03:06 1396646 /usr/local/lib/j2sdk1.4.2_06/jre/lib/rt.jar 42069000-4207f000 r--s 00000000 03:06 1395797 /usr/local/lib/j2sdk1.4.2_06/jre/lib/sunrsasign.jar 4207f000-4215c000 r--s 00000000 03:06 1396647 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jsse.jar 4215c000-4216d000 r--s 00000000 03:06 1395798 /usr/local/lib/j2sdk1.4.2_06/jre/lib/jce.jar 4216d000-426c6000 r--s 00000000 03:06 1396648 /usr/local/lib/j2sdk1.4.2_06/jre/lib/charsets.jar 4c7f0000-4c80c000 r--s 00000000 03:06 7673083 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/sunjce_provider.jar 4c80c000-4c819000 r--s 00000000 03:06 7673085 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/ldapsec.jar 4c819000-4c8d5000 r--s 00000000 03:06 7673086 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/localedata.jar 4c8d5000-4c8dc000 r--s 00000000 03:06 7429060 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/RXTXcomm.jar 4c8dc000-4c8e4000 r--s 00000000 03:06 7429061 /usr/local/lib/j2sdk1.4.2_06/jre/lib/ext/comm.jar 4c8e4000-4c8ee000 r-xp 00000000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so 4c8ee000-4c8ef000 rw-p 00009000 03:06 3462063 /usr/local/lib/j2sdk1.4.2_06/jre/lib/i386/librxtxSerial.so Heap at VM Abort: Heap def new generation total 576K, used 338K [0x44770000, 0x44810000, 0x44c50000) eden space 512K, 66% used [0x44770000, 0x447c48a0, 0x447f0000) from space 64K, 0% used [0x447f0000, 0x447f0000, 0x44800000) to space 64K, 0% used [0x44800000, 0x44800000, 0x44810000) tenured generation total 1408K, used 0K [0x44c50000, 0x44db0000, 0x48770000) the space 1408K, 0% used [0x44c50000, 0x44c50000, 0x44c50200, 0x44db0000) compacting perm gen total 4096K, used 1170K [0x48770000, 0x48b70000, 0x4c770000) the space 4096K, 28% used [0x48770000, 0x48894810, 0x48894a00, 0x48b70000) Local Time = Sat Nov 6 21:32:12 2004 Elapsed Time = 0 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_06-b03 mixed mode) # Any ideas?? Thanks. -Kenny -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20041107/88e9502e/attachment-0137.html From taj at www.linux.org.uk Sat Nov 6 22:40:43 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 05:40:43 +0000 (GMT) Subject: [Rxtx] native VM errors in Debian? In-Reply-To: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> References: <2BB2EBAEE8BAB84BBBE618F34E98228A03A061D5@exchange.net.ist.ucf.edu> Message-ID: On Sat, 6 Nov 2004, McCoig, Kenneth wrote: > Hello list! > My setup: Debian, latest Sun Java SDK > Downloaded and installed rxtx-2.0-7pre1 (note I did not apt-get install > Followed the HOWTO for setting up RXTX. > I am attempting to use the sample programs that come with the Java Comm API and I get this crazy error: > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x40009315 > Function=_dl_relocate_object+0x65 > Library=/lib/ld-linux.so.2 > Current Java thread: > at java.lang.ClassLoader$NativeLibrary.load(Native Method) Did you compile rxtx? This looks very suspicous. Maybe an ABI problem. The library is blowing up while loading. The INSTALL instructions in the tar ball should work on debian when compiling from source. The apt archives also got updated recently and should work. -- Trent Jarvi taj at www.linux.org.uk From taj at www.linux.org.uk Sun Nov 7 08:50:24 2004 From: taj at www.linux.org.uk (Trent Jarvi) Date: Sun, 7 Nov 2004 15:50:24 +0000 (GMT) Subject: [Rxtx] reading data from serial port on redhat In-Reply-To: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> References: <20041103230934.43204.qmail@web202.biz.mail.re2.yahoo.com> Message-ID: On Wed, 3 Nov 2004, Raine Wang wrote: > Hi, > > I wrote a program to read external device's data > thought serial port. This program need to run at > windows and linux. It runs at windows very well. But > when it runs at linux, it meets a weird problem with > the same external device. It can't get data from the > serial port.It checked the available() and uses > enableReceiveTimeout(). I found there is no data > available. But if I turn on the external device after > the redhat booted up, the program can run and get > data. This program doesn't meet this problem at > windows. This external device doesn't need the driver, > it talks with the pc throught serial port. Now I am > wondering if it is the OS problem or the program > problem. This is far from my limited knowledge. > Welcome any idea. Thanks in advance. After talking to rmk (Linux serial drivers) I have perhaps a hint at what is going on here. At least it may give you an idea where to look. When you open the port, it is going to raise RTS and DSR. Then the port is setup but the device may be trying to talk already. In your application, this may be unreliable/unpredictable. What may need to be done, when the port is opened, RTS/DSR are dropped to prevent anymore data from being sent. Read and discard any data. Then setup the port and then raise the RTS/DTR. rxtx 2.1 has some undocumented extensions to CommAPI available which I think got requested for simular reasons. 'preopened' port manipulation. This gives one control of the RTS/DSR before the Java open() is called. Without knowing more about what is going on, thats about all that could be said at this point. -- Trent Jarvi taj at www.linux.org.uk From lingcronin at yahoo.com Tue Nov 2 05:26:36 2004 From: lingcronin at yahoo.com (Aisling Cronin) Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: <20041102122636.78104.qmail@web12008.mail.yahoo.com> Hi I'm getting the same error except in english WriteFile outputStream write error- java/io/IOException: The security account database contains an inconsistency in writeByte- I was using MichalHobot's rxtx on ipaq 5455 with jeode to communicate via BT It opens up the bluetooth wince controller app which i guess would be the first stage to opening the port but it doesn't get any further Did you find out what the cause of this error was? __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail From doktorbernd at hotmail.com Tue Nov 2 07:40:27 2004 From: doktorbernd at hotmail.com (Doktor Bernd) Date: Tue, 02 Nov 2004 14:40:27 +0000 Subject: [Rxtx] rxtx on iPAQ, strange Exception Message-ID: Hi, well, I think I solved that problem but it was a lot of try and error, so I am not sure what I did exactly. This is what I wrote on the list after I solved the problem, but reading it now I think it won't be much help. I think it just says "I have no idea". "I think I got the Exception because I was using port 3 which is the IRComm port on iPAQ. My registry was pointing to COM2: but I couldn't open that port and on the net I found a guy who was claiming that COM2 is the raw IR port on iPAQ. So I flashed my ROM again and suddenly I had a COM2:" Hope you have the same luck as me, FReAK >From: Aisling Cronin >Reply-To: Java RXTX discussion >To: Rxtx at linuxgrrls.org >Subject: [Rxtx] rxtx on iPAQ, strange Exception >Date: Tue, 2 Nov 2004 04:26:36 -0800 (PST) > >Hi I'm getting the same error except in english > >WriteFile outputStream write error- >java/io/IOException: The security account database >contains an inconsistency in writeByte- > >I was using MichalHobot's rxtx on ipaq 5455 with jeode >to communicate via BT > >It opens up the bluetooth wince controller app which i >guess would be the first stage to opening the port but >it doesn't get any further > >Did you find out what the cause of this error was? > > > >__________________________________ >Do you Yahoo!? >Yahoo! Mail Address AutoComplete - You start. We finish. >http://promotions.yahoo.com/new_mail >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://mailman.linuxgrrls.org/mailman/listinfo/rxtx _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.com/ From sean_gilbertson at fin-rec.com Tue Nov 2 09:42:44 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:42:44 -0600 Subject: [Rxtx] Garbage/invalid data? Message-ID: <20041102164244.GA378@demeter> Has anyone had problems with RXTX returning garbage or invalid or incorrect data, without returning or raising an error? I wrote some software to retrieve data from a serial device, and things have been working fine for 11 months, but with a new application (which uses my same data retrieval class), which receives heavier loads under increased frequency, I have received some bogus values. Not too many -- about 3 in 700 -- but any is too many, because now I can't totally trust my data. If anyone knows why RXTX (or anything else) would cause this, with ostensibly no errors, please let me know. Thank you very much. -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From sean_gilbertson at fin-rec.com Tue Nov 2 09:43:37 2004 From: sean_gilbertson at fin-rec.com (Sean Gilbertson) Date: Tue, 2 Nov 2004 10:43:37 -0600 Subject: [Rxtx] re: Garbage data Message-ID: <20041102164337.GA459@demeter> I'm using RXTX 2.0-5 -- Sean Gilbertson IT Systems/Software Developer This document may contain sensitive information which is intended for the recipient only. Any unauthorized use of the material included in this message could result in criminal investigation. If you have received this message in error please notify the sender. From lonedesign_2k at yahoo.com Wed Nov 3 05:21:24 2004 From: lonedesign_2k at yahoo.com (Dodger) Date: Wed, 3 Nov 2004 14:21:24 +0200 Subject: [Rxtx] Modem/Serial Comm. Problem In-Reply-To: Message-ID: Found the problem... I wasn't sending a hang-up command so the modem was remaining in an off-hook state. This explains why it was working on first execution only